import {Column, Entity, Index, ManyToOne} from "typeorm";
import {HouseEntity} from "~/modules/assess/house/house.entity";
import {CommonEntity} from "~/common/entity/common.entity";

@Index(["id"])
@Entity({name: 'access_house_tag'})
export class TagEntity extends CommonEntity {

  @Column({name: 'name', nullable: true, comment: '标签名称'})
  name: string;

  @Column({name: 'x', type: "float", comment: 'x坐标'})
  x: number;

  @Column({name: 'y', type: "float", comment: 'y坐标'})
  y: number;

	@Column({name: 'houseType', nullable: true, comment: '户型'})
	houseType: number;

  @Column({name: 'roomType', nullable: true, comment: '标签类型'})
  roomType: number;

	@Column({name: 'position', nullable: true, comment: '方位：0-中宫，1-西北，2-正北，3-东北，4-正东，5-东南，6-正南，7-西南，8-正西'})
  position: number;

	@Column({name: 'realSecret', nullable: true, comment: '真诀描述'})
	realSecret: string;

  @Column({name: 'detail', nullable: true, comment: '详批'})
  detail: string;

  @ManyToOne(() => HouseEntity, house => house.tags)
  house: HouseEntity;
}
